/*
 * PyGeoReactor.cpp
 *
 *  Created on: Jan 2, 2012
 *      Author: allan
 */

#include "PyGeoReactor.h"

// GeoReact includes
#include <GeoReact.h>

// Boost includes
#include <boost/python.hpp>
using namespace boost::python;

const dict
ReactStepWithTPn(const GeoReactor& reactor,
	double t, double t1, double dt, double T, double P, VectorXd& n)
{
	reactor.ReactStep(t, t1, dt, T, P, n);
	
	dict res; res["t"] = t; res["dt"] = dt; return res;
}

const dict
ReactStepWithGeoState(const GeoReactor& reactor,
	double t, double t1, double dt, GeoState& state)
{
	reactor.ReactStep(t, t1, dt, state);
	
	dict res; res["t"] = t; res["dt"] = dt; return res;
}

void export_GeoReactor()
{
	void (GeoReactor::*ReactWithTPn)(double, double, double, double, double, VectorXd&) const = 
		&GeoReactor::React;
	
	void (GeoReactor::*ReactWithGeoState)(double, double, double, GeoState&) const = 
		&GeoReactor::React;
	
	class_<GeoReactor>("GeoReactor")
		.def(init<>())
		.def(init<const GeoReactor&>())
		.def(init<const KineticSystem&>())
		
		.def("ReactStep",
			ReactStepWithTPn)
		
		.def("ReactStep",
			ReactStepWithGeoState)
		
		.def("React",
			ReactWithTPn)
		
		.def("React",
			ReactWithGeoState);
}
